#!/usr/bin/python3
# -*- coding:utf-8 -*-
"""
@File: maxKbView.py
@Author: lijk34925 
@Date: 2025/4/17 16:21
@desc: 请补充本模块功能说明
"""
from fastapi import APIRouter
from pydantic import BaseModel

from Models.MaxKbApi import MaxKbApi

router = APIRouter()
# 打开应用
MaxKbAPP = MaxKbApi()
MaxKbAPP.open_session()


class MaxKbReq(BaseModel):
    project: str = "AML5"
    question: str = ""


@router.post("/knowledge")
async def getKnowledge(content: MaxKbReq):
    res = MaxKbAPP.get_knowledge(content.question)
    return {"message": f"project： {content.project}", "data": res, "code": 200}

